#include <stdio.h>
#include <stdlib.h>
void squeeze(char[],char[]);

#define MAGIC_BIG 1024
int main ()
{
  char goners[MAGIC_BIG];
  char s[MAGIC_BIG];
  for (int i=0; i<MAGIC_BIG; i++)
    s[i]=goners[i]=0;
  printf("string : ?>");
  char in='1';
  
  int i =0;
  while ((in!=EOF) && (in != '\n'))
    {
	 in=s[i]=getchar();
	 i++;
	 if (i>MAGIC_BIG)
	   {
		printf("\n string too big \n");
		return -1;
	   }
    }
  
  printf("remove : ?>");

  i=0;
  in = '1';
  while ((in!=EOF) && (in != '\n'))
    {
	 in=goners[i]=getchar();
	 i++;
	 if (i>MAGIC_BIG)
	   {
		printf("\n delim string too big \n");
		return -1;
	   }
    }  
  squeeze(s,goners);
  for (i =0; s[i] != '\0';i++)
    printf("%c",s[i]);
  return (0);
} 

/** goners MUST BE a null terminated string*/
void squeeze(char s[], char goners[])
{
  for (int i = 0; goners[i] != '\0'; i++)
    {
	 int j=0,k=0;
	 for (; s[j]!='\0'; j++)
	   if (s[j] != goners[i])
		s[k++] = s[j];
	 s[k] = '\0';
     }
}


